package en.edu.cuit.aumalls.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import cn.edu.cuit.aumalls.entity.Goods;

public interface FindGoodsMapper {

	@Select("select * from goods where goods_type = #{goods_type}")
	List<Goods> findGoodsBytype(@Param("goods_type")int goods_type);
	
	@Select("select * from goods where goods_price between #{startPrice} and #{endPrice}")
	List<Goods> findGoodsByPrice(@Param("startPrice")float startPrice,@Param("endPrice")float endPrice);
	
	@Select("select * from goods where goods_price > #{startPrice}")
	List<Goods> findGoodsByStartPrice(@Param("startPrice")float startPrice);
	
	@Select("select * from goods where goods_price < #{endPrice}")
	List<Goods> findGoodsByEndPrice(@Param("endPrice")float endPrice);
	
	@Select("SELECT * from goods where goods_name LIKE concat('%',#{goodsName},'%')")
	List<Goods> findGoodsByName(@Param("goodsName")String goodsName);
}
